package com.study.ApplicationEvent2.config;

import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import com.study.ApplicationEvent2.UserBean;
import com.study.ApplicationEvent2.UserRegisterEvent;

@Component
public class RegisterListener implements ApplicationListener<UserRegisterEvent>{

	@Override
	public void onApplicationEvent(UserRegisterEvent event) {

		
		//获取注册对象
		UserBean user = event.getUser();
		
		//业务逻辑
		
		//输出注册信息
		System.out.format("ApplicationListener 注册成功, 用户名: %s, 密码： %s", user.getName(),user.getPassword());
		
	}

	
}
